/* 薪酬 基础设置api */

import { ajaxService } from '@/utils/request';
import * as type from './type';

const env = import.meta.env;
// const baseURL1 = env.VITE_API_BASE_URL;
// const baseURL1 = env.VITE_DEV_BASE_URL// const baseURL = 'http://192.168.31.129:39003';
// const baseURL = 'http://192.168.31.129:39003';
const baseURL = env.VITE_DEV_BASE_URL;
// const baseURL = env.VITE_APP_BASE_URL;
const baseURL2 = env.VITE_APP_BASE_URL;
const baseURL3 = env.VITE_DEV_BASE_URL;

/**
 * 新增最低工资
 */
export function AddMiniSalary(data: type.TaddMiniSalary) {
  return ajaxService({
    url: '/hr/salary/basic_setting/minimum_wage/wage/add',
    method: 'post',
    data,
    baseURL
  });
}

/**
 * 新增最低工资查重
 */
export function CheckMiniSalaryRepeat(params: { cityCode: string }) {
  return ajaxService({
    url: '/hr/salary/basic_setting/minimum_wage/wage/repeat',
    method: 'get',
    params,
    baseURL
  });
}

/**
 * 获取最低工资列表
 */
export function GetMiniSalaryList(params: type.pageSetting) {
  return ajaxService({
    url: '/hr/salary/basic_setting/minimum_wage/wage/list',
    method: 'get',
    params,
    baseURL
  });
}

/**
 * 删除最低工资列表
 */
export function DelMiniSalaryList(data: { ids: number }) {
  return ajaxService({
    url: '/hr/salary/basic_setting/minimum_wage/wage/delete',
    method: 'delete',
    data,
    baseURL
  });
}

/**
 * 编辑最低工资
 */
export function ModifyMiniSalary(data: type.TaddMiniSalary) {
  return ajaxService({
    url: '/hr/salary/basic_setting/minimum_wage/wage/update',
    method: 'put',
    data,
    baseURL
  });
}
